package cn.gotom.pinggu.action;

import java.util.List;

import cn.gotom.coding.EncodingUtils;
import cn.gotom.core.service.UniversalService;
import cn.gotom.core.web.Constants;
import cn.gotom.core.web.action.SupportAction;
import cn.gotom.pinggu.pojos.Sjbdb;
import cn.gotom.pinggu.pojos.Trcc;

import com.google.inject.Inject;

public class MainAction extends SupportAction
{
	private static final long serialVersionUID = 1L;

	public String execute() throws Exception
	{
		this.trccList = universalService.find(Trcc.class, 20, 0);
		this.sjbdbList = universalService.findAll(Sjbdb.class);
		for (Object o : this.trccList)
		{
			EncodingUtils.encoding(o, "cp850", "GBK");
		}
		for (Sjbdb o : this.sjbdbList)
		{
			EncodingUtils.encoding(o, "cp850", "GBK");
		}
		return Constants.SUCCESS;
	}

	@Inject
	private UniversalService universalService;

	private List<Sjbdb> sjbdbList;

	private List<Trcc> trccList;

	public List<Sjbdb> getSjbdbList()
	{
		return sjbdbList;
	}

	public void setSjbdbList(List<Sjbdb> sjbdbList)
	{
		this.sjbdbList = sjbdbList;
	}

	public List<Trcc> getTrccList()
	{
		return trccList;
	}

	public void setTrccList(List<Trcc> trccList)
	{
		this.trccList = trccList;
	}

}
